import router from '../router/index'
import $bus from '../bus/index'

router.beforeEach((to, from) => {
    let token = sessionStorage.getItem('settoken')
    if (!token) {

        if (to.path !== '/login') {
            return {
                path: '/login'
            }
        }
    }

})

router.afterEach((to)=>{
    $bus.$emit('ccc',to.matched)
})



